<%@ include file="base.jsp" %>

<html>
<head>
	<SCRIPT LANGUAGE="JavaScript">
	<!--
		javascript:window.history.forward(1);
		
		function change_bg(cell)
		{
			cell.className="cell-mouseover";
			document.getElementById(cell).style.backgroundImage ='url(' + "<%=imagePath%>/left-menu-middle-grey.gif" + ')';
		}
		function outset(cell)
		{
			cell.className ="white-smalltext";
			document.getElementById(cell).style.backgroundImage ='url(' +"<%=imagePath%>/left-menu-middle.gif" +')';
		}
		function setAction(clickAction)
		{
			document.SaveToDBForm.action.value = clickAction;
			document.SaveToDBForm.submit();
		}
	//-->
	</SCRIPT>
<meta content="text/html; charset=UTF-8" http-equiv="content-type">
<title><bean:message key="ibroker.previewLinks.title" /></title>
<link rel="stylesheet" type="text/css" href="<%=oStylesheet%>" />
</head>

<body>
<table cellspacing=25 border=0 cellpadding=0>
	<tr>
		<td height=120><img src="<%=logoPath%>?<%=dt.getTime()%>" width="120" height="120" /></td>
		<td height=120 width=605 colspan=2><img
			src="<%=bannerPath%>?<%=dt.getTime()%>" height=120 width=605 /></td>
	</tr>
	<tr>
		<td valign=top>
		<table border=0 cellspacing=0 cellpadding=0 width=100%>
			<tr>
				<td id="td0" height="20px" background="<%=imagePath%>/left-menu-top.gif" ></td>
			</tr>
		<%
			// Get Modified Links
			int len = 0;
			if (((String) session.getAttribute("LinksData")).indexOf(',') > -1)
			{
				String linksData = (String) session.getAttribute("LinksData");
				String links[] = linksData.split(", ");
	            len = links.length;
	            for (int i=1; i<(len+1); i++)
	            {
	            	String name[] = links[i-1].split("=");
		%>
					<tr>
						<td id="td<%=i%>" background="<%=imagePath%>/left-menu-middle.gif"
							width="120" height="32px" class="white-smalltext"
							onmouseover="change_bg('td<%=i%>');" onmouseout="outset('td<%=i%>');">&nbsp;&nbsp;
							<a class="link-nounderline white-smalltext" href="<%=name[1]%>"><%=name[0]%></a>
						</td>
					</tr>
		<%
				}
			}
			else
			{
				if (((String) session.getAttribute("LinksData")).length()>0)
				{
					len = 1;
					String name[] = ((String) session.getAttribute("LinksData")).split("=");
		%>
					<tr>
						<td id="td1" background="<%=imagePath%>/left-menu-middle.gif"
							height="32px" class="white-smalltext"
							onmouseover="change_bg('td1');" onmouseout="outset('td1');">&nbsp;&nbsp;
							<a class="link-nounderline white-smalltext" href="<%=name[1]%>"><%=name[0]%></a>
						</td>
					</tr>
		<%
				}
			}
			if (len<8)
			{
				for (int j=len+1; j<9; j++)
				{
		%>
					<tr>
						<td id="td<%=j%>" background="<%=imagePath%>/left-menu-middle-blank.gif"
							width="120" height="32px"></td>
					</tr>
		<%
				}
			}
		%>
			<tr>
				<td id="td9"><img src="<%=imagePath%>/left-menu-bottom.gif" width="120"></td>
			</tr>
		</table>
		</td>

		<td width=290 valign=top>
		<table>
			<tr>
			<td valign="top">
			<table cellpadding="0" cellspacing="0" width="100%" height="100%">
				<tr height="45px">
					<td height="45px" width="10px" bgcolor="#999999"><img src="<%=imagePath%>/grey-square.gif"></td>
					<td height="45px" bgcolor="#999999" align="left" valign="middle">
						<table cellpadding="0" cellspacing="0">
							<tr>
								<td width="190" align="left">								
									<img src="<%=imagePath%>/title_manager_preview_links.gif" align="left"/>
								</td>
								<td width="60" align="right">
									<html:link action="Logout">
										<img src="<%=imagePath%>/button-logout.jpg" border="0" align="right"/>
									</html:link>
								</td>
							</tr>
						</table>
					</td>
					<td height="45px" width="10px" bgcolor="#999999"><img src="<%=imagePath%>/grey-square.gif"></td>
				</tr>
				<tr height="182px">
					<td width="10px" bgcolor="#999999"><img src="<%=imagePath%>/grey-square.gif"></td>
					<td bgcolor="#CCCCCC" width="270">
						<table>
							<tr>
							<td>
							<table>
								<tr>
									<td align="left" colspan="4">
									<font class="blue-smalltext"><b><html:errors/></b></font>
								</tr>
								<tr>
									<td align="center" colspan="2">
									<font size="4">&nbsp;</font>
								</tr>
								<tr>
									<td align="left" colspan="4">
									<b class="blue-smalltext"><bean:message key="ibroker.previewLinks.text" /></b>
									</td>
								</tr>
								<tr>
									<td align="center" colspan="2">
									<font size="4">&nbsp;</font>
								</tr>
								<tr>
									<html:form action="/SaveToDBForm">
										<td align="right" colspan="1">
										&nbsp;<html:hidden property="dataType" value="links"/>
										&nbsp;<html:hidden property="action"/>
										</td>
										<td align="right" colspan="1">
										<img src="<%=imagePath%>/button-save.jpg" onclick="setAction('confirm');"></img>
										</td>
										<td align="center" colspan="2">
										<img src="<%=imagePath%>/button-cancel.jpg" onclick="setAction('cancel');"></img>
										</td>
									</html:form>
								</tr>
								<tr height="80px">
									<td align="center" colspan="2">
									<font size="4">&nbsp;</font>
								</tr>
								<tr height="40px">
									<td align="center" colspan="2">
									<font size="4">&nbsp;</font>
								</tr>
							</table>
							</td>
							</tr>
						</table>
					</td>
					<td width="10px" bgcolor="#999999"><img src="<%=imagePath%>/grey-square.gif"></td>
				</tr>
				<tr height="10px">
					<td colspan="3" bgcolor="#999999"></td>
				</tr>
			</table>
			</td>
			</tr>
		</table>
		</td>
		<%@ include file="bottom.jsp" %>
</table>
</body>
</html>





